package com.xpec.c4.game.utility.dbtool;

import java.util.LinkedHashMap;

public class TableInfos {
	
	public TableInfos(String tableName){
		this.tableName = tableName;
	}
	
	private String tableName;
	
	private LinkedHashMap<String, String> columns = new LinkedHashMap<String, String>();
	
	private LinkedHashMap<String, String> indexs = new LinkedHashMap<String, String>();
	
	private String createTableCommand;
	
	/**
	 * 是否有這個欄位
	 * @param columnName
	 * @return
	 */
	public String getColumn(String columnName) {
		if (columns.containsKey(columnName)) {
			return columns.get(columnName);
		}
		return null;
	}
	
	/**
	 * 是否有這個 Index
	 * @param index
	 * @return
	 */
	public String getIndex(String indexName) {
		if (indexs.containsKey(indexName)) {
			return indexs.get(indexName);
		}
		return null;
	}

	public String getTableName() {
		return tableName;
	}

	public void setTableName(String tableName) {
		this.tableName = tableName;
	}

	public LinkedHashMap<String, String> getColumns() {
		return columns;
	}

	public void setColumns(LinkedHashMap<String, String> columns) {
		this.columns = columns;
	}

	public LinkedHashMap<String, String> getIndexs() {
		return indexs;
	}

	public void setIndexs(LinkedHashMap<String, String> indexs) {
		this.indexs = indexs;
	}

	public String getCreateTableCommand() {
		return createTableCommand;
	}

	public void setCreateTableCommand(String createTableCommand) {
		this.createTableCommand = createTableCommand;
	}
}
